'''
Created on May 3, 2010

@author: behrooz
'''

from django.conf.urls.defaults import patterns


urlpatterns = patterns('amscms.ams.views',
    (r'^$', 'ad_list'),
    (r'^view/(?P<object_id>\d+)/$', 'ad_view'),
    (r'^update/(?P<object_id>\d+)/$', 'ad_update'),
    (r'^delete/(?P<object_id>\d+)/$', 'ad_delete'),
    (r'^register/$', 'ad_register'),
    (r'^register/confirm/$', 'ad_register_confirm'),
    
    (r'^search/$', 'search_ads_by_query'),
    (r'^search/page/(?P<page>[\d]+)/$', 'search_ads_by_query'),
    
    (r'^explore/$', 'explore_ads_by_query'),
    (r'^explore/page/(?P<page>[\d]+)/$', 'explore_ads_by_query'),
    (r'^explore/(?P<mode>\w+)/$', 'explore_ads_by_query'),
    (r'^explore/(?P<mode>\w+)/page/(?P<page>[\d]+)/$', 'explore_ads_by_query'),
    
    (r'^like/(?P<id>\d+)$', 'ad_like'),
    (r'^dislike/(?P<id>\d+)$', 'ad_dislike'),
    
    # Ads by Advertizer
    (r'explore/advertizer/(?P<id>[\d]+)/$', 'explore_ads_by_advertizer'),
    (r'explore/advertizer/(?P<id>[\d]+)/page/(?P<page>[\d]+)/$', 'explore_ads_by_advertizer'),
    # Tags
    (r'^tag/popular/$', 'find_popular_tags'),
    (r'^tag/explore/(?P<tagid>\d+)/$', 'explore_ads_by_tag'),
    (r'^tag/explore/(?P<tagid>\d+)/page/(?P<page>[\d]+)/$', 'explore_ads_by_tag'),
    
    # User Personalized
    (r'^$', 'ad_list'),
    (r'^page/(?P<page>[\d]+)/$', 'ad_list'),
    (r'^reports/$', 'ad_reports'),
    (r'^reports/page/(?P<page>[\d]+)/$', 'ad_reports'),
    
    (r'^orders/$', 'ad_order_list'),
    (r'^orders/page/(?P<page>[\d]+)/$', 'ad_order_list'),
    (r'^orders/pay/(?P<id>\d+)/$', 'ad_order_pay'),
    (r'^orders/pay/$', 'ad_order_pay'),
    
    
    (r'^payments/$', 'adorder_payment_list'),
    (r'^payments/page/(?P<page>[\d]+)/$', 'adorder_payment_list'),
    
    (r'^deposits/$', 'credit_deposit_list'),
    (r'^deposits/page/(?P<page>[\d]+)/$', 'credit_deposit_list'),
    
    (r'^advertizers/$', 'advertizer_list'),
    (r'^advertizers/page/(?P<page>[\d]+)/$', 'advertizer_list'),
    
    (r'^advertizer/register/$', 'advertizer_register'),
    
    
)

